<jsp:include page="../template/top.jsp"></jsp:include>
	<form action="${pageContext.request.contextPath}/servico/lista" method="get">
		<div class="interfaceExterna">
			<h3><a href="#">Filtros</a></h3>
			<div>
				<div class="campo">
					<label>Descri&ccedil;&atilde;o</label>
					<input type="text" id="descricao" value="${servico.descricao}" name="servico.descricao" />
				</div>
			</div>
		</div>
	
		<br clear="all" />
	
		<div class="botoes">
			<input type="submit" id="botaoBuscar" value="Buscar" />
			<a href="${pageContext.request.contextPath}/servico/novo" id="botaoNovo">Novo</a>
		</div>
	</form>
	
	<br clear="all" />

	<div class="interfaceExterna">
		<h3><a href="#">Servi&ccedil;os</a></h3>
		<div>
			<table>
				<thead>
					<tr>
						<th></th>
						<th width="50px" align="left"></th>
						<th width="200px" align="left">Descri&ccedil;&atilde;o</th>
						<th width="150px" align="left">Valor</th>
						<th>Situa&ccedil;&atilde;o</th>
					</tr>
				</thead>
				
				<tbody>
					<c:if test="${not empty servicoList}">
						<c:forEach var="servico" items="${servicoList}">
							<tr>
								<td>
									<form action="${pageContext.request.contextPath}/servico/${servico.id}" method="post">
										<button type="submit" onclick="return confirm('Tem certeza que deseja inativar este serviço?')" 
												class="ui-state-default ui-corner-all" title="Inativar">
											<span class="ui-icon ui-icon-trash"></span>
										</button>
									</form>
								</td>
								
								<td>
									<form action="${pageContext.request.contextPath}/servico/mostra/${servico.id}" method="get">
										<button type="submit" title="Editar" 
											class="ui-state-default ui-corner-all">
											<span class="ui-icon ui-icon-document"></span>
										</button>
									</form>
								</td>
								<td> ${servico.descricao} </td>
								<td> <fmt:formatNumber currencySymbol="R$ " type="currency" value="${servico.valor}"></fmt:formatNumber> </td>
								<td>
									<c:if test="${servico.ativo}">
										Ativo
									</c:if>
									<c:if test="${not servico.ativo}">
										Inativo
									</c:if>
								</td>
							</tr>
						</c:forEach>
					</c:if>
					<c:if test="${empty servicoList}">
						<tr>
							<td colspan="5">Nenhum servi&ccedil;o encontrado!</td>
						</tr>
					</c:if>
				</tbody>
			</table>
		</div>
	</div>
		
<jsp:include page="../template/bottom.jsp"></jsp:include>